Leadtools.ImageProcessing.Core Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
CorrelationListCommand Constructor(RasterImage,Point[],Int32[],Int32,Int32,Int32)
See Also  Example
Leadtools.ImageProcessing.Core Namespace > CorrelationListCommand Class > CorrelationListCommand Constructor : CorrelationListCommand Constructor(RasterImage,Point[],Int32[],Int32,Int32,Int32)



correlationImage
RasterImage object that references the image(s) for which to search.
points
Array of Point objects to be updated with the starting points of the correlated areas.
listIndex
Array of integers to be updated with the indices of the images that match correlated areas.
xStep
Step size in the X direction (along image width), in pixels. For best results, use 1.
yStep
Step size in the Y direction (along image height), in pixels. For best results, use 1.
threshold
Value that indicates the correlation threshold, which is a measure of the association necessary for two areas to be considered to be correlated. If the correlation value between an image in the list and an area in the reference image is less than the correlation threshold they are uncorrelated. Valid values range from 0 (zero resemblance) to 100 (perfect resemblance).
Initializes a new CorrelationListCommand with explicit parameters.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal correlationImage As RasterImage, _
   ByVal points() As Point, _
   ByVal listIndex() As Integer, _
   ByVal xStep As Integer, _
   ByVal yStep As Integer, _
   ByVal threshold As Integer _
)
Visual Basic (Usage)Copy Code
Dim correlationImage As RasterImage
Dim points() As Point
Dim listIndex() As Integer
Dim xStep As Integer
Dim yStep As Integer
Dim threshold As Integer
 
Dim instance As CorrelationListCommand(correlationImage, points, listIndex, xStep, yStep, threshold)
C# 
public CorrelationListCommand( 
   RasterImage correlationImage,
   Point[] points,
   int[] listIndex,
   int xStep,
   int yStep,
   int threshold
)
C++/CLI 
public:
CorrelationListCommand( 
   RasterImage correlationImage,
   array<Point>^ points,
   array<int>^ listIndex,
   int xStep,
   int yStep,
   int threshold
)

Parameters

correlationImage
RasterImage object that references the image(s) for which to search.
points
Array of Point objects to be updated with the starting points of the correlated areas.
listIndex
Array of integers to be updated with the indices of the images that match correlated areas.
xStep
Step size in the X direction (along image width), in pixels. For best results, use 1.
yStep
Step size in the Y direction (along image height), in pixels. For best results, use 1.
threshold
Value that indicates the correlation threshold, which is a measure of the association necessary for two areas to be considered to be correlated. If the correlation value between an image in the list and an area in the reference image is less than the correlation threshold they are uncorrelated. Valid values range from 0 (zero resemblance) to 100 (perfect resemblance).

Example

Run the CorrelationListCommand on an image

Visual BasicCopy Code
Public Sub CorrelationListConstructorExample()
   ' Load an image
   RasterCodecs.Startup()
   Dim codecs As RasterCodecs = New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim image As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")

   Dim copyRectangle As CopyRectangleCommand = New CopyRectangleCommand()

   Dim rc_cor As Rectangle = New Rectangle(327, 378, 22, 28)
   copyRectangle.Rectangle = rc_cor
   copyRectangle.Run(image)
   Dim correlationImage As RasterImage = copyRectangle.DestinationImage.Clone()

   rc_cor = New Rectangle(283, 378, 22, 28)
   copyRectangle.Rectangle = rc_cor
   copyRectangle.Run(image)
   correlationImage.AddPage(copyRectangle.DestinationImage.Clone())

   Dim points(30) As Point
   Dim listIndex(30) As Integer

   Dim command As CorrelationListCommand = New CorrelationListCommand(correlationImage, points, listIndex, 1, 1, 90)
   command.Run(image)

   RasterCodecs.Shutdown()
End Sub
C#Copy Code
public void CorrelationListConstructorExample() 

   // Load an image 
   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg"); 
 
   CopyRectangleCommand copyRectangle = new CopyRectangleCommand(); 
 
   Rectangle rc_cor = new Rectangle(327, 378, 22, 28); 
   copyRectangle.Rectangle = rc_cor; 
   copyRectangle.Run(image); 
   RasterImage correlationImage = copyRectangle.DestinationImage.Clone(); 
 
   rc_cor = new Rectangle(283, 378, 22, 28); 
   copyRectangle.Rectangle = rc_cor; 
   copyRectangle.Run(image); 
   correlationImage.AddPage(copyRectangle.DestinationImage.Clone()); 
 
   Point[] points = new Point[30]; 
   int[] listIndex = new int[30]; 
 
   CorrelationListCommand command = new CorrelationListCommand(correlationImage, points, listIndex, 1, 1, 90); 
   command.Run(image); 
 
   RasterCodecs.Shutdown(); 
}

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also